<!-- <!DOCTYPE html>
<html>
<head>
<title>Trang chủ Về Miền Trung | Du Lịch Miền Trung | Du lịch Con đường di sản</title>
<meta charset="UTF-8">
<meta name="description" content="Khám phá Miền Trung - Du Lịch Miền Trung - Tư vấn du lịch Miền Trung - Ẩm thực Miền Trung - Địa danh du lịch Miền Trung - Lễ hội Miền Trung - Con người Miền Trung - Tin tức Miền Trung - Du lịch Con Đường Di Sản - Du lịch Quảng Bình - Du lịch Quảng Trị - Du lịch Huế - Du lịch Đà Nẵng - Du lịch Hội An, Quảng Nam ">
<meta name="keywords" content="Miền Trung, Về miền trung, Du Lịch Miền Trung, Ẩm thực miền trung, địa danh miền trung, Khách sạn Miền Trung, Khám phá Miền Trung, Tư vấn du lịch Miền Trung, Ẩm thực Miền Trung, Địa danh du lịch Miền Trung, Lễ hội Miền Trung, Tin tức Miền Trung, Du lịch Con Đường Di Sản, Du lịch Quảng Bình, Du lịch Quảng Trị, Du lịch Huế, Du lịch Đà Nẵng, Du lịch Hội An, Quảng Nam ">
<link rel="shortcut icon" href="images/icon.png" type="image/vnd.microsoft.icon" />
<link rel="stylesheet" href="css/home.css">
<link rel="stylesheet" href="css/bootstrap.css">
<!-- Latest compiled and minified CSS -->
<?php 
    $tintucmois = $viewModel->get('tintucmois'); 
    $baivietmois = $viewModel->get('baivietmois'); 
    $amthucs = $viewModel->get('amthucs'); 
    $lehois = $viewModel->get('lehois'); 
    $clips = $viewModel->get('clips'); 
    $medias = $viewModel->get('medias'); 
    $diadiemdulichs = $viewModel->get('diadiemdulichs'); 
    $baivietxemnhieus = $viewModel->get('baivietxemnhieus'); 
 ?>
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>

<script type="text/javascript">
  $(document).ready(function() {
    $('.carousel').carousel({
        interval: 2000,
        pause: “hover”,
          wrap: true
      });
  });
  </script>
<script type="text/javascript">
  $('#bs-example-navbar-collapse-1').on('show.bs.collapse', function () {
  $('#bs-example-navbar-collapse-1').append($('#sidebar').html());
  $('#bs-example-navbar-collapse-1 ul').last().removeClass('nav-pills nav-stacked').addClass('navbar navbar-nav');
  });
  $('#bs-example-navbar-collapse-1').on('hidden.bs.collapse', function () {
  $('#bs-example-navbar-collapse-1 ul:last-child').remove();
  });
  $(window).on('resize', function () {
    if (window.innerWidth > 768) {$('#bs-example-navbar-collapse-1').collapse('hide');}
  });
</script>


  
  <section class="main_content">
    <div class="container">
      <div class="row">
        <div class="col-md-8 col-xs-12">
          <div class="news-feed clearfix news-rss">
            <img class="icon_news" src="<?php echo PATH_IMAGE ?>/icon/news.jpg"/>
            <marquee class="news" direction="left" scrollamount="4" onmouseover="this.stop()" onmouseout="this.start()">
              <?php foreach ($tintucmois as $tintucmoi) { ?>                                    
                  <a href="<?php echo BASE_URL.'baiviet/detail/'.$tintucmoi->DuongDan; ?>"><span class="new_go" style="margin-left:30px"><?php echo $tintucmoi->TieuDe ?> </span></a>
              <?php } ?>
            </marquee>
          </div>
          <div id="carousel-example-generic" class="carousel slide carousels" data-ride="carousel">
              <ol class="carousel-indicators">
                <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
                <li data-target="#carousel-example-generic" data-slide-to="1"></li>
                <li data-target="#carousel-example-generic" data-slide-to="2"></li>
              </ol>
              <div class="carousel-inner clearfix">
                <div class="item active">
                    <img src="<?php echo PATH_IMAGE ?>/du-lich-hue.jpg" alt="Du Lịch Huế">
                    <div class="carousel-caption">
                      Du Lịch Huế
                    </div>
                </div>
                <div class="item">
                  <img src="<?php echo PATH_IMAGE ?>/du-lich-da-nang.jpg" alt="Du lịch Đà Nẵng">
                <div class="carousel-caption">
                Du lịch Đà Nẵng
                </div>
                </div>
                <div class="item">
                  <img src="<?php echo PATH_IMAGE ?>/du-lich-quang-binh.jpg" alt="Du lịch Quảng Bình">
                <div class="carousel-caption">
                Du lịch Quảng Nam
                </div>
                </div>
              </div>
            <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
                <span class="glyphicon glyphicon-chevron-left"></span>
            </a>
            <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
                <span class="glyphicon glyphicon-chevron-right"></span>
            </a>
          </div>
        </div>
        <div class="col-xs-12 col-lg-4 col-md-4 news-fee follow-us">
          <span style="float:left; font-weight:bold;">Follow us</span>
          <div style="float:right">
            <a href="https://www.facebook.com/vemientrung4r" target="_blank"><img src="<?php echo PATH_IMAGE ?>/icon/facebook.png" alt="Facebook Du lịch miền trung" class="social"></a>
            <a href="https://www.youtube.com/channel/UC-eMuq4U44i4W67xlZea7jg" target="_blank"><img src="<?php echo PATH_IMAGE ?>/icon/youtube.png" alt="Youtube Du lịch miền trung" class="social"></a>
            <a href="https://plus.google.com/u/0/b/114494777838477341578/114494777838477341578/videos" target="_blank"><img src="<?php echo PATH_IMAGE ?>/icon/g+.png" alt="G+  Du lịch miền trung" class="social"></a>
            <a href="http://vemientrung.com/"><img src="<?php echo PATH_IMAGE ?>/icon/twitter.png" alt="Twitter Du lịch miền trung" class="social"></a>
            <a href="http://vemientrung.com/"><img src="<?php echo PATH_IMAGE ?>/icon/rss.png" alt="RSS Du lịch miền trung" class="social"></a>
          </div>
        </div>
        <div class="col-xs-12 col-lg-4 col-md-4" id="content">
          <div class="panel-info panel-body hides">
            <ul>
            <?php foreach ($baivietmois as $baivietmoi) { ?>                                    
              <li class="media bt-top">
                <a class="pull-left" href="<?php echo BASE_URL.'baiviet/detail/'.$baivietmoi->DuongDan; ?>">
                  <img src="<?php if(!empty($baivietmoi->AnhThumb)){echo $baivietmoi->AnhThumb;}else{echo PATH_IMAGE.'bai-viet.png';}  ?>" height="70px" width="70px" title="<?php echo $baivietmoi->TieuDe ?>" alt="<?php echo $baivietmoi->TieuDe ?>" class="news-img img-thumbnail">
                </a>
                <div class="media-body">                  
                    <h4 class="media-heading">
                      <a class="pull-left" href="<?php echo BASE_URL.'baiviet/detail/'.$baivietmoi->DuongDan; ?>">
                        
                          <?php 
                            if (strlen($baivietmoi->TieuDe)<40)
                            {
                              echo $baivietmoi->TieuDe;
                            }
                            else
                            {
                              $strCut = substr($baivietmoi->TieuDe, 0, 40);
                              echo substr($strCut, 0, strrpos($strCut, ' ')).'...';
                            }
                         ?>
                      </a>
                    </h4>
                     <br>
                     <p class="info_small">
                          <?php 
                            if (strlen($baivietmoi->MoTa)<100)
                            {
                              echo $baivietmoi->MoTa;
                            }
                            else
                            {                              
                              $strCut = substr($baivietmoi->MoTa, 0, 100);
                              echo substr($strCut, 0, strrpos($strCut, ' ')).'...';
                            }
                         ?>
                     </p>
                </div>
              </li>
            <?php } ?> 
            </ul>
            <a class="lines-btn-up"><span class="glyphicon glyphicon-chevron-up"></span></a>
            <a class="lines-btn-down"><span class="glyphicon glyphicon-chevron-down"></span></a>
          </div>
        </div>
      </div>
    <div>
  </section>
  <section class="center_content_top">
    <div class="container">
      <div class="row">
        <div class="col-md-4 col-xs-12">
          <div class="panel panel-warning">
            <div class="panel-heading"><span class="glyphicon glyphicon-cutlery"></span> Ẩm thực miền trung</div>
            <div class="panel-body">
              <div class="row">
                <?php foreach ($amthucs as $amthuc) { ?>    
                  <div class="col-md-6 food-zone">
                    <a class="pull-left" href="<?php echo BASE_URL.'baiviet/detail/'.$amthuc->DuongDan; ?>">
                      <img src="<?php if(!empty($amthuc->AnhThumb)){echo $amthuc->AnhThumb;}else{echo PATH_IMAGE.'bai-viet.png';}  ?>"  title="<?php echo $amthuc->TieuDe ?>" alt="<?php echo $amthuc->TieuDe ?>" class="img-food">
                    </a>
                    <a class="pull-left" href="<?php echo BASE_URL.'baiviet/detail/'.$amthuc->DuongDan; ?>">
                    <span class="food-title">
                      <?php 
                                if (strlen($amthuc->TieuDe)<30)
                                {
                                  echo $amthuc->TieuDe;
                                }
                                else
                                {                                  
                                  $strCut = substr($amthuc->TieuDe, 0, 30);
                                  echo substr($strCut, 0, strrpos($strCut, ' ')).'...';
                                }
                             ?>
                    </span>
                    </a>
                  </div>                                
                  
                <?php } ?> 
            </ul>
                 
              </div>
              <div class="view_many">
                <span><!-- Hơn 5000 món ăn --></span>&nbsp<a href="<?php echo BASE_URL.'baiviet/category/am-thuc'; ?>"><span class="label label-primary">Xem thêm</span></a>
              </div>
            </div>
          </div>
        </div>
        <div class="col-md-4 col-xs-12 ov">
           <div class="panel panel-warning">
            <div class="panel-heading"><span class="glyphicon glyphicon-certificate"></span> Văn hóa - lễ hội</div>
            <div class="panel-body panel-lehoi">
              <div class="row">
                    <ul>
                <?php foreach ($lehois as $lehoi) { ?>                                    
                  <li class="media bt-top">
                    <a class="pull-left" href="<?php echo BASE_URL.'baiviet/detail/'.$lehoi->DuongDan; ?>">
                      <img src="<?php if(!empty($lehoi->AnhThumb)){echo $lehoi->AnhThumb;}else{echo PATH_IMAGE.'bai-viet.png';}  ?>" height="70px" width="70px" title="<?php echo $lehoi->TieuDe ?>" alt="<?php echo $lehoi->TieuDe ?>" class="img-responsive news-img img-thumbnail">
                    </a>
                    <div class="media-body">                  
                        <h4 class="media-heading">
                          <a class="pull-left" href="<?php echo BASE_URL.'baiviet/detail/'.$lehoi->DuongDan; ?>">
                            
                              <?php 
                                if (strlen($lehoi->TieuDe)<40)
                                {
                                  echo $lehoi->TieuDe;
                                }
                                else
                                {
                                  $strCut = substr($lehoi->TieuDe, 0, 40);
                                  echo substr($strCut, 0, strrpos($strCut, ' ')).'...';
                                }
                             ?>
                          </a>
                        </h4>
                         <br>
                         <p class="info_small">
                              <?php 
                                if (strlen($lehoi->MoTa)<100)
                                {
                                  echo $lehoi->MoTa;
                                }
                                else
                                {
                                  echo substr($lehoi->MoTa, 0, 100).'...';
                                }
                             ?>
                         </p>
                    </div>
                  </li>
                <?php } ?> 
            </ul>
                 
              </div>
              <div class="view_many">
                <span><!-- Hơn 5000 món ăn --></span>&nbsp<a href="<?php echo BASE_URL.'baiviet/category/van-hoa'; ?>"><span class="label label-primary">Xem thêm</span></a>
              </div>
            </div>
          </div>
        </div>
        <div class="col-md-4 col-xs-12">
          <div class="panel panel-warning">
            <div class="panel-heading"><span class="glyphicon glyphicon-map-marker"></span> ĐIỂM ĐẾN MIỀN TRUNG</div>
            <div class="panel-body panel-lehoi">
              <div class="row">
                    <ul>
                <?php foreach ($diadiemdulichs as $diadiemdulich) { ?>                                    
                  <li class="media bt-top">
                    <a class="pull-left" href="<?php echo BASE_URL.'diadiemdulich/place/'.$diadiemdulich->Alias; ?>">
                      <img src="<?php if(!empty($diadiemdulich->HinhAnh)){echo $diadiemdulich->HinhAnh;}else{echo PATH_IMAGE.'bai-viet.png';}  ?>" height="70px" width="70px" title="<?php echo $diadiemdulich->TenDiem ?>" alt="<?php echo $diadiemdulich->TenDiem ?>" class="img-place">
                    </a>
                    <div class="media-body">                  
                        <h4 class="media-heading">
                          <a class="pull-left title-place" href="<?php echo BASE_URL.'diadiemdulich/place/'.$diadiemdulich->Alias; ?>">
                            
                              <?php 
                                if (strlen($diadiemdulich->TenDiem)<50)
                                {
                                  echo $diadiemdulich->TenDiem;
                                }
                                else
                                {
                                  echo substr($diadiemdulich->TenDiem, 0, 50).'...';
                                }
                             ?>
                          </a>
                        </h4>
                        <br>
                       <p><span class="glyphicon glyphicon glyphicon-eye-open rate"> <?php echo number_format($diadiemdulich->SoLuotXem) ?></span></p>
                        
                    </div>
                  </li>
                <?php } ?> 
            </ul>
                 
              </div>
              <div class="view_many">
                <span><!-- Hơn 5000 món ăn --></span>&nbsp<a href="<?php echo BASE_URL.'diadiemdulich/tracuu'; ?>"><span class="label label-primary">Xem thêm</span></a>
              </div>
            </div>
          </div>
         <!--  <div class="panel-info">
            <div class="panel-heading">Địa điểm được quan tâm</div>
            <div class="panel-bai-viet">
              <ul class="list-news">
              <?php foreach ($diadiemdulichs as $diadiemdulich) { ?>                                    
                <li class="media bt-top"><a href="<?php echo BASE_URL.'diadiemdulich/place/'.$diadiemdulich->Alias; ?>"><?php echo $diadiemdulich->TenDiem ?></a></li>
              <?php } ?> 
              </ul>
              <div class="view_many">
                <a href="#"><span class="label label-primary">Xem thêm</span></a>
              </div>
              <a class="lines-btn-up"><span class="glyphicon glyphicon-chevron-up"></span></a>
              <a class="lines-btn-down"><span class="glyphicon glyphicon-chevron-down"></span></a>
            </div>
          </div> -->
        </div>
      </div>
    </div>
  </section>
  <section class="center_content_bottom">
    <div class="container">
      <div class="row">
        <div class="col-md-4">
            <div class="panel panel-warning">
            <div class="panel-heading"><span class="glyphicon glyphicon-facetime-video"></span> Clip - Hình ảnh về Miền Trung</div>
            <div class="panel-body">
              <div class="row">
                <div class="col-md-12 clearfix">
                  <iframe width="100%" height="250" src="http://www.youtube.com/embed/Nu8m15Oo984" frameborder="0" allowfullscreen></iframe>
                  <p class="bg-warning tx-clip">Clip du lịch phố cổ Hội An</p>
                  <ul class="list-news">
                    <?php foreach ($medias as $media) { ?>                                    
                     <li class="media"><a href="<?php echo BASE_URL.'baiviet/detail/'.$media->DuongDan; ?>">
                       <?php 
                                if (strlen($media->TieuDe)<35)
                                {
                                  echo $media->TieuDe;
                                }
                                else
                                {
                                  echo substr($media->TieuDe, 0, 35).'...';
                                }
                             ?>
                     </a>
                      <span class="glyphicon glyphicon glyphicon-eye-open rate"> <?php echo number_format($media->SoLuotXem) ?></span>
                     </li>
                    <?php } ?>
                  </ul>
                   <div class="view_many">
                <a href="<?php echo BASE_URL.'baiviet/category/clip'?>"><span class="label label-primary">Xem thêm</span></a>
              </div>
                </div>
                
            </div>
          </div>
        </div>
        </div>
        <div class="col-md-4">
             <div class="panel panel-warning">
            <div class="panel-heading"><span class="glyphicon glyphicon-star"></span> Bài viết xem nhiều</div>
            <div class="panel-body">
              <ul class="list-news">
              <?php foreach ($baivietxemnhieus as $baivietxemnhieu) { ?>                                    
                <li class="media bt-top">
                  <a href="<?php echo BASE_URL.'baiviet/detail/'.$baivietxemnhieu->DuongDan; ?>"><?php echo $baivietxemnhieu->TieuDe ?></a>

                </li>

              <?php } ?> 
              </ul>
             
              
            </div>
          </div>
        </div>
        <div class="col-md-4">
          
            <iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fvemientrung4r&amp;width=360&amp;height=260&amp;colorscheme=light&amp;show_faces=true&amp;header=true&amp;stream=false&amp;show_border=true&amp;appId=493739817355796" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:360px; height:260px;" allowTransparency="true"></iframe>
            <a href="#"><img src="<?php echo PATH_IMAGE.'da-nang-hotel.jpg' ?>" class="img-responsive"></a>
            
        </div>
      </div>
    </div>
  </section>
  <!-- <section class="center_content_bottom">
    <div class="container">
      <div class="row">
        <div class="col-md-8">
          
        <div class="col-md-4">
          <div class="panel panel-info">            
            <a href="#"><img src="<?php echo PATH_IMAGE.'maps-quangcao.png' ?>" class="img-responsive"></a>
            <a href="#"><img src="<?php echo PATH_IMAGE.'da-nang-hotel.jpg' ?>" class="img-responsive"></a>
          </div>
        </div>
      </div>
    </div>
  </section> -->
  
  
  
  
<script type="text/javascript">
$(document).ready(function() {
    var numsofitem = $('#content .panel-info .media').length;
    var numsofitem1 = $('#le-hoi .panel-le-hoi .media').length;
    var numsofitem2 = $('#bai-viet .panel-bai-viet .media').length;
  var scroll_container = $('#content .panel-info').outerHeight();
  var scroll_height = numsofitem*92 - scroll_container;
  var scroll_container1 = $('#le-hoi .panel-le-hoi').outerHeight();
  var scroll_height1 = numsofitem1*95 - scroll_container1;
  var scroll_container2 = $('#bai-viet .panel-bai-viet').outerHeight();
  var scroll_height2 = numsofitem2*22 - scroll_container2;

    if ($(window).outerWidth() < 481) {
        $('#content .panel-info').css( 'height', numsofitem*92 + 'px' );
        $('#content .panel-info ul').css( 'top', 0 + 'px' );
    $('#content .panel-info .lines-btn-down, #content .panel-info .lines-btn-up').addClass('hide');

    $('#le-hoi .panel-le-hoi').css( 'height', numsofitem1*95 + 'px' );
        $('#le-hoi .panel-le-hoi ul').css( 'top', 0 + 'px' );
    $('#le-hoi .panel-le-hoi .lines-btn-down, #le-hoi .panel-le-hoi .lines-btn-up').addClass('hide');

    $('#bai-viet .panel-bai-viet').css( 'height', numsofitem2*22 + 'px' );
        $('#bai-viet .panel-bai-viet ul').css( 'top', 0 + 'px' );
    $('#bai-viet .panel-bai-viet .lines-btn-down, #bai-viet .panel-bai-viet .lines-btn-up').addClass('hide');

    }else if ($(window).outerWidth() < 768) {
        $('#content .panel-info').css( 'height', numsofitem*92 + 'px' );
        $('#content .panel-info ul').css( 'top', 0 + 'px' );
    $('#content .panel-info .lines-btn-down, #content .panel-info .lines-btn-up').addClass('hide');

    $('#le-hoi .panel-le-hoi').css( 'height', numsofitem1*95 + 'px' );
        $('#le-hoi .panel-le-hoi ul').css( 'top', 0 + 'px' );
    $('#le-hoi .panel-le-hoi .lines-btn-down, #le-hoi .panel-le-hoi .lines-btn-up').addClass('hide');

    $('#bai-viet .panel-bai-viet').css( 'height', numsofitem2*22 + 'px' );
        $('#bai-viet .panel-bai-viet ul').css( 'top', 0 + 'px' );
    $('#bai-viet .panel-bai-viet .lines-btn-down, #bai-viet .panel-bai-viet .lines-btn-up').addClass('hide');
    }else if ($(window).outerWidth() < 992) {
        $('#content .panel-info').css( 'height', '378px' );
    scroll_container = 378;
    scroll_height = numsofitem*92 - scroll_container;

    $('#le-hoi .panel-le-hoi').css( 'height', '326px' );
    scroll_container1 = 326;
    scroll_height1 = numsofitem1*95 - scroll_container1;

    $('#bai-viet .panel-bai-viet').css( 'height', '326px' );
    scroll_container2 = 326;
    scroll_height2 = numsofitem2*22 - scroll_container2;

    if ($('#content .panel-info ul').position().top >= 0) {
      $('#content .panel-info .lines-btn-up').addClass('hide');
    }else {
      $('#content .panel-info .lines-btn-up').removeClass('hide');
    }

    if ($('#content .panel-info ul').position().top <= -scroll_height) {
      $('#content .panel-info .lines-btn-down').addClass('hide');
    }else {
      $('#content .panel-info .lines-btn-down').removeClass('hide');
    }


    if ($('#le-hoi .panel-le-hoi ul').position().top >= 0) {
      $('#le-hoi .panel-le-hoi .lines-btn-up').addClass('hide');
    }else {
      $('#le-hoi .panel-le-hoi .lines-btn-up').removeClass('hide');
    }

    if ($('#le-hoi .panel-le-hoi ul').position().top <= -scroll_height1) {
      $('#le-hoi .panel-le-hoi .lines-btn-down').addClass('hide');
    }else {
      $('#le-hoi .panel-le-hoi .lines-btn-down').removeClass('hide');
    }


    if ($('#bai-viet .panel-bai-viet ul').position().top >= 0) {
      $('#bai-viet .panel-bai-viet .lines-btn-up').addClass('hide');
    }else {
      $('#bai-viet .panel-bai-viet .lines-btn-up').removeClass('hide');
    }

    if ($('#bai-viet .panel-bai-viet ul').position().top <= -scroll_height2) {
      $('#bai-viet .panel-bai-viet .lines-btn-down').addClass('hide');
    }else {
      $('#bai-viet .panel-bai-viet .lines-btn-down').removeClass('hide');
    }

    }else if ($(window).outerWidth() < 1200) {
        $('#content .panel-info').css( 'height', '378px' );
    scroll_container = 378;
    scroll_height = numsofitem*92 - scroll_container;

    if ($('#content .panel-info ul').position().top == 0) {
      $('#content .panel-info .lines-btn-up').addClass('hide');
    }else {
      $('#content .panel-info .lines-btn-up').removeClass('hide');
    }

    if ($('#content .panel-info ul').position().top == -scroll_height) {
      $('#content .panel-info .lines-btn-down').addClass('hide');
    }else {
      $('#content .panel-info .lines-btn-down').removeClass('hide');
    }


    $('#le-hoi .panel-le-hoi').css( 'height', '326px' );
    scroll_container1 = 326;
    scroll_height1 = numsofitem1*95 - scroll_container1;

    if ($('#le-hoi .panel-le-hoi ul').position().top == 0) {
      $('#le-hoi .panel-le-hoi .lines-btn-up').addClass('hide');
    }else {
      $('#le-hoi .panel-le-hoi .lines-btn-up').removeClass('hide');
    }

    if ($('#le-hoi .panel-le-hoi ul').position().top == -scroll_height1) {
      $('#le-hoi .panel-le-hoi .lines-btn-down').addClass('hide');
    }else {
      $('#le-hoi .panel-le-hoi .lines-btn-down').removeClass('hide');
    }

    $('#bai-viet .panel-bai-viet').css( 'height', '326px' );
    scroll_container2 = 326;
    scroll_height2 = numsofitem2*22 - scroll_container2;

    if ($('#bai-viet .panel-bai-viet ul').position().top == 0) {
      $('#bai-viet .panel-bai-viet .lines-btn-up').addClass('hide');
    }else {
      $('#bai-viet .panel-bai-viet .lines-btn-up').removeClass('hide');
    }

    if ($('#bai-viet .panel-bai-viet ul').position().top == -scroll_height2) {
      $('#bai-viet .panel-bai-viet .lines-btn-down').addClass('hide');
    }else {
      $('#bai-viet .panel-bai-viet .lines-btn-down').removeClass('hide');
    }

    }else {
        $('#content .panel-info').css( 'height', '460px' );
    scroll_container = 460;
    scroll_height = numsofitem*92 - scroll_container;

    if ($('#content .panel-info ul').position().top == 0) {
      $('#content .panel-info .lines-btn-up').addClass('hide');
    }else {
      $('#content .panel-info .lines-btn-up').removeClass('hide');
    }

    if ($('#content .panel-info ul').position().top == -scroll_height) {
      $('#content .panel-info .lines-btn-down').addClass('hide');
    }else {
      $('#content .panel-info .lines-btn-down').removeClass('hide');
    }


    $('#le-hoi .panel-le-hoi').css( 'height', '380px' );
    scroll_container1 = 380;
    scroll_height1 = numsofitem1*95 - scroll_container1;

    if ($('#le-hoi .panel-le-hoi ul').position().top == 0) {
      $('#le-hoi .panel-le-hoi .lines-btn-up').addClass('hide');
    }else {
      $('#le-hoi .panel-le-hoi .lines-btn-up').removeClass('hide');
    }

    if ($('#le-hoi .panel-le-hoi ul').position().top == -scroll_height1) {
      $('#le-hoi .panel-le-hoi .lines-btn-down').addClass('hide');
    }else {
      $('#le-hoi .panel-le-hoi .lines-btn-down').removeClass('hide');
    }


    $('#bai-viet .panel-bai-viet').css( 'height', '380px' );
    scroll_container2 = 380;
    scroll_height2 = numsofitem2*22 - scroll_container2;

    if ($('#bai-viet .panel-bai-viet ul').position().top == 0) {
      $('#bai-viet .panel-bai-viet .lines-btn-up').addClass('hide');
    }else {
      $('#bai-viet .panel-bai-viet .lines-btn-up').removeClass('hide');
    }

    if ($('#bai-viet .panel-bai-viet ul').position().top == -scroll_height1) {
      $('#bai-viet .panel-bai-viet .lines-btn-down').addClass('hide');
    }else {
      $('#bai-viet .panel-bai-viet .lines-btn-down').removeClass('hide');
    }
    }

  $(window).resize( function () {
        if ($(window).outerWidth() < 481) {
            $('#content .panel-info').css( 'height', numsofitem*92 + 'px' );
          $('#content .panel-info ul').css( 'top', 0 + 'px' );
      $('#content .panel-info .lines-btn-down, #content .panel-info .lines-btn-up').addClass('hide');


      $('#le-hoi .panel-le-hoi').css( 'height', numsofitem1*95 + 'px' );
          $('#le-hoi .panel-le-hoi ul').css( 'top', 0 + 'px' );
      $('#le-hoi .panel-le-hoi .lines-btn-down, #le-hoi .panel-le-hoi .lines-btn-up').addClass('hide');

      $('#bai-viet .panel-bai-viet').css( 'height', numsofitem2*22 + 'px' );
          $('#bai-viet .panel-bai-viet ul').css( 'top', 0 + 'px' );
      $('#bai-viet .panel-bai-viet .lines-btn-down, #bai-viet .panel-bai-viet .lines-btn-up').addClass('hide');

        }else if ($(window).outerWidth() < 768) {
            $('#content .panel-info').css( 'height', numsofitem*92 + 'px' );
          $('#content .panel-info ul').css( 'top', 0 + 'px' );
      $('#content .panel-info .lines-btn-down, #content .panel-info .lines-btn-up').addClass('hide');


      $('#le-hoi .panel-le-hoi').css( 'height', numsofitem1*95 + 'px' );
          $('#le-hoi .panel-le-hoi ul').css( 'top', 0 + 'px' );
      $('#le-hoi .panel-le-hoi .lines-btn-down, #le-hoi .panel-le-hoi .lines-btn-up').addClass('hide');

      $('#bai-viet .panel-bai-viet').css( 'height', numsofitem2*22 + 'px' );
          $('#bai-viet .panel-bai-viet ul').css( 'top', 0 + 'px' );
      $('#bai-viet .panel-bai-viet .lines-btn-down, #bai-viet .panel-bai-viet .lines-btn-up').addClass('hide');

        }else if ($(window).outerWidth() < 992) {
            $('#content .panel-info').css( 'height', '378px' );
      $('#content .panel-info .lines-btn-down, #content .panel-info .lines-btn-up').removeClass('hide');
      scroll_container = 378;


      $('#le-hoi .panel-le-hoi').css( 'height', '326px' );
      $('#le-hoi .panel-le-hoi .lines-btn-down, #le-hoi .panel-le-hoi .lines-btn-up').removeClass('hide');
      scroll_container1 = 378;

      $('#bai-viet .panel-bai-viet').css( 'height', '326px' );
      $('#bai-viet .panel-bai-viet .lines-btn-down, #bai-viet .panel-bai-viet .lines-btn-up').removeClass('hide');
      scroll_container2 = 378;

        }else if ($(window).outerWidth() < 1200) {
            $('#content .panel-info').css( 'height', '378px' );
      $('#content .panel-info .lines-btn-down, #content .panel-info .lines-btn-up').removeClass('hide');
      scroll_container = 378;


      $('#le-hoi .panel-le-hoi').css( 'height', '378px' );
      $('#le-hoi .panel-le-hoi .lines-btn-down, #le-hoi .panel-le-hoi .lines-btn-up').removeClass('hide');
      scroll_container1 = 378;

      $('#bai-viet .panel-bai-viet').css( 'height', '378px' );
      $('#bai-viet .panel-bai-viet .lines-btn-down, #bai-viet .panel-bai-viet .lines-btn-up').removeClass('hide');
      scroll_container2 = 378;

        }else {
            $('#content .panel-info').css( 'height', '460px' );
      $('#content .panel-info .lines-btn-down, #content .panel-info .lines-btn-up').removeClass('hide');
      scroll_container = 460;


      $('#le-hoi .panel-le-hoi').css( 'height', '390px' );
      $('#le-hoi .panel-le-hoi .lines-btn-down, #le-hoi .panel-le-hoi .lines-btn-up').removeClass('hide');
      scroll_container1 = 390;

      $('#bai-viet .panel-bai-viet').css( 'height', '390px' );
      $('#bai-viet .panel-bai-viet .lines-btn-down, #bai-viet .panel-bai-viet .lines-btn-up').removeClass('hide');
      scroll_container2 = 390;

    }
    scroll_height = numsofitem*92 - scroll_container;
    scroll_height1 = numsofitem1*95 - scroll_container1;
    scroll_height2 = numsofitem2*22 - scroll_container2;
  });

  $('#content .panel-info .lines-btn-up').hover(function () {
    var curent_p = 0 - $('#content .panel-info ul').position().top;
    var time = curent_p/92;
    $('#content .panel-info ul').animate({top: 0}, 300*time, 'swing', function () {
      $('#content .panel-info .lines-btn-up').addClass('hide');
    });
    $('#content .panel-info .lines-btn-down').removeClass('hide');
    if ($('#content .panel-info ul').position().top == 0) {
      $('#content .panel-info .lines-btn-up').addClass('hide');
    }else {
      $('#content .panel-info .lines-btn-up').removeClass('hide');
    }
  }, function () {
    $('#content .panel-info ul').stop(true, false);
  });


  $('#le-hoi .panel-le-hoi .lines-btn-up').hover(function () {
    var curent_p1 = 0 - $('#le-hoi .panel-le-hoi ul').position().top;
    var time1 = curent_p1/95;
    $('#le-hoi .panel-le-hoi ul').animate({top: 0}, 300*time1, 'swing', function () {
      $('#le-hoi .panel-le-hoi .lines-btn-up').addClass('hide');
    });
    $('#le-hoi .panel-le-hoi .lines-btn-down').removeClass('hide');
    if ($('#le-hoi .panel-le-hoi ul').position().top == 0) {
      $('#le-hoi .panel-le-hoi .lines-btn-up').addClass('hide');
    }else {
      $('#le-hoi .panel-le-hoi .lines-btn-up').removeClass('hide');
    }
  }, function () {
    $('#le-hoi .panel-le-hoi ul').stop(true, false);
  });

  $('#bai-viet .panel-bai-viet .lines-btn-up').hover(function () {
    var curent_p2 = 0 - $('#bai-viet .panel-bai-viet ul').position().top;
    var time2 = curent_p2/22;
    $('#bai-viet .panel-bai-viet ul').animate({top: 0}, 300*time2, 'swing', function () {
      $('#bai-viet .panel-bai-viet .lines-btn-up').addClass('hide');
    });
    $('#bai-viet .panel-bai-viet .lines-btn-down').removeClass('hide');
    if ($('#bai-viet .panel-bai-viet ul').position().top == 0) {
      $('#bai-viet .panel-bai-viet .lines-btn-up').addClass('hide');
    }else {
      $('#bai-viet .panel-bai-viet .lines-btn-up').removeClass('hide');
    }
  }, function () {
    $('#bai-viet .panel-bai-viet ul').stop(true, false);
  });


  $('#content .panel-info .lines-btn-down').hover(function () {
    var curent_p = scroll_height + $('#content .panel-info ul').position().top;
    var time = curent_p/92;
    $('#content .panel-info ul').animate({top: -scroll_height}, 300*time, 'swing', function () {
      $('#content .panel-info .lines-btn-down').addClass('hide');
    });
    $('#content .panel-info .lines-btn-up').removeClass('hide');
    if ($('#content .panel-info ul').position().top == -scroll_height) {
      $('#content .panel-info .lines-btn-down').addClass('hide');
    }else {
      $('#content .panel-info .lines-btn-down').removeClass('hide');
    }
  }, function () {
    $('#content .panel-info ul').stop(true, false)
  });


  $('#le-hoi .panel-le-hoi .lines-btn-down').hover(function () {
    var curent_p1 = scroll_height1 + $('#le-hoi .panel-le-hoi ul').position().top;
    var time1 = curent_p1/95;
    $('#le-hoi .panel-le-hoi ul').animate({top: -scroll_height1}, 300*time1, 'swing', function () {
      $('#le-hoi .panel-le-hoi .lines-btn-down').addClass('hide');
    });
    $('#le-hoi .panel-le-hoi .lines-btn-up').removeClass('hide');
    if ($('#le-hoi .panel-le-hoi ul').position().top == -scroll_height1) {
      $('#le-hoi .panel-le-hoi .lines-btn-down').addClass('hide');
    }else {
      $('#le-hoi .panel-le-hoi .lines-btn-down').removeClass('hide');
    }
  }, function () {
    $('#le-hoi .panel-le-hoi ul').stop(true, false)
  });


  $('#bai-viet .panel-bai-viet .lines-btn-down').hover(function () {
    var curent_p2 = scroll_height2 + $('#bai-viet .panel-bai-viet ul').position().top;
    var time2 = curent_p2/22;
    $('#bai-viet .panel-bai-viet ul').animate({top: -scroll_height2}, 300*time2, 'swing', function () {
      $('#bai-viet .panel-bai-viet .lines-btn-down').addClass('hide');
    });
    $('#bai-viet .panel-bai-viet .lines-btn-up').removeClass('hide');
    if ($('#bai-viet .panel-bai-viet ul').position().top == -scroll_height2) {
      $('#bai-viet .panel-bai-viet .lines-btn-down').addClass('hide');
    }else {
      $('#bai-viet .panel-bai-viet .lines-btn-down').removeClass('hide');
    }
  }, function () {
    $('#bai-viet .panel-bai-viet ul').stop(true, false)
  });


});
</script>
